using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMask : MonoBehaviour
{
    private Material maskMaterial;
    public float visibleRadius = 5f;

    private void Start()
    {
        maskMaterial = this.GetComponent<SpriteRenderer>().material;
    }

    void Update()
    {
        // 传递玩家位置和参数到Shader
        maskMaterial.SetVector("_PlayerPos", GameManager.Instance.player.transform.position);
        maskMaterial.SetFloat("_VisibleRadius", visibleRadius);
    }

}
